package com.qiuhu.designerpattern.singleton;

/**
 * 双重加锁--单例模式
 * 
 * @author Administrator
 *
 */
public class SychronizedSingleton {

	private static SychronizedSingleton singleton;
	private SychronizedSingleton() {
	}
	
	public static SychronizedSingleton getInstance() {
		
		if (null == singleton) {
			synchronized (SychronizedSingleton.class) {
				if (null == singleton) {
					singleton = new SychronizedSingleton();
				}
			}
		}
		
		return singleton;
	}
	
}
